//
//  TZImageTool.h
//  
//  jhf
//
//  Created by 计海峰 on 2017/6/20.
//  Copyright © 2017年 计海峰. All rights reserved.
//
 
#import <Foundation/Foundation.h>
#import <CooperSDK/CooperSDK.h>
#import <TZImagePickerController/TZImagePickerController.h>

@interface TZImageTool : NSObject

JSingletonH();

//@property (nonatomic, strong) TZImagePickerController *imagePickerVC;

/**
 获得单张图片
 可能需要代理 所以私有方法
 @param clipping 是否剪辑
 @param target 某个controller
 @param block 回调
 */
- (void)addSinglePhotoWithClipping:(BOOL)clipping andTarget:(UIViewController *)target andBLock:(BlockValue)block;

/**
 获得单张图片
 
 @param radio 剪裁比例
 @param target 某个controller
 @param block 回调
 */
- (void)addSinglePhotoClippingRadio:(CGFloat)radio andTarget:(UIViewController *)target andBLock:(BlockValue)block;

/**
 添加多个图片

 @param maxNum 图片最大数量
 @param selectedAssets 已经选过的
 @param target 某个controller
 @param block 回调
 */
+ (void)addPhotosMaxNum:(NSInteger)maxNum selectedAssets:(NSMutableArray *)selectedAssets andTarget:(UIViewController *)target andBlock:(void (^)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto))block;

/**
 添加视频或者图片

 @param maxNum 最大数量
 @param selectedAssets 已经选过的
 @param target 某个controller
 @param videoQuality 视频品质 默认 AVAssetExportPresetLowQuality
 @param imageBlock imageBlock
 @param videoBlock videoBlock
 */
+ (void)addPhotosOrSingleVideoMaxNum:(NSInteger)maxNum selectedAssets:(NSMutableArray *)selectedAssets andTarget:(UIViewController *)target videoQuality:(NSString *)videoQuality andBlock:(void (^)(NSArray<UIImage *> *photos,NSArray *assets,BOOL isSelectOriginalPhoto))imageBlock andSingleVideo:(void(^)(UIImage *coverImage, id asset))videoBlock;

/// 获取视频
/// @param target 某个controller
/// @param videoQuality 视频品质 默认 AVAssetExportPresetLowQuality
/// @param videoBlock videoBlock
+ (void)addSingleVideoWithTarget:(UIViewController *)target videoQuality:(NSString *)videoQuality videoBlock:(void (^)(UIImage *coverImage, id asset))videoBlock;


/// 获取视频
/// @param target 某个controller
/// @param maxCount 最多获取几个
/// @param videoBlock videoBlock
+ (void)addVideosWithTarget:(UIViewController *)target maxCount:(NSInteger)maxCount videoBlock:(void (^)(NSArray<UIImage *> *coverImage, NSArray *assets, NSArray<NSDictionary *> *infos))videoBlock;

/// 导出视频
/// @param asset 获取视频的PHAsset
/// @param videoBlock videoBlock
/// @param failure failure
+ (void)convertPHAssetToViedo:(id)asset videoBlock:(void (^)(id path))videoBlock failure:(void (^)(NSString *errorMessage, NSError *error))failure;

/// 获取基础picker
+ (TZImagePickerController *)imagePickerVC;

@end
